<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBannerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('banner', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('merchant_id')   ->default(0) ->comment('商家id');
            $table->bigInteger('img_id')   ->default(0)->comment('banner图片ID');
            $table->string('title')     ->nullable()->comment('标题');
            $table->string('link_url')  ->nullable()->comment('链接');
            $table->string('location')  ->default('')->comment('放置位置：index首页');
            $table->integer('sort')     ->default(0)->comment('排序');
            $table->integer('status')   ->default(0)->comment('状态，0:隐藏，1:显示');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('banner');
    }
}
